package org.tmad.ocms.service;

import org.apache.log4j.Logger;
import org.tmad.ocms.dao.CaseDAO;
import org.tmad.ocms.dao.ForgotpasswordDAO;
import org.tmad.ocms.exceptions.ApplicationException;
import org.tmad.ocms.log.LogFactory;
import org.tmad.ocms.model.Case;

public class ForgotPasswordService {
	private ForgotpasswordDAO fDAO = null;
	private static Logger logger = LogFactory.getLogger();

	
	public boolean forgotPassword(String email,String password) throws ApplicationException{
		
		boolean result =false;
		fDAO = new ForgotpasswordDAO();
		try{
		result = fDAO.forgotPassword(email,password);
		
		}catch(Exception e){
			logger.error("error while registration ", e);
			throw new ApplicationException("Unable to register" + e.getMessage());
		}
		
		// writer.write("Registration is successful");
		
		sendPasswordDetails(user.getCaseType(), user.getHelpType(), user.getNeedyName(),user.getDescription(),user.getAddress(),user.getEmailId());
	    return result;
	}


	public void sendPasswordDetails(String email) {
		// TODO Auto-generated method stub
		
	}
	

}
